package net.xiduth.game.player.content;

import net.xiduth.game.WorldObject;
import net.xiduth.game.player.Player;

/**
 * Class that handles RuneScape lodestone activating.
 * 
 * @author _Jordan / Apollo <citellumrsps@gmail.com>
 * @author Feather RuneScape 2012 Remake
 */
public class LodeStones {
	
	private static boolean[] activatedLodeStones = new boolean[14];
	
	private static final int LUMBRIDGE = 69836, DRAYNOR = 69833;
	private static int[][] lodeStones = { { 10907, LUMBRIDGE },
			{ 10904, DRAYNOR } };

	/**
	 * Checks the object id then sends the necessary config. Activates the
	 * lodestone for the player.
	 * 
	 * @Param player
	 * @Param object
	 */
	public void activateLodestone(final Player player, WorldObject object) {
		if (object.getId() == lodeStones[0][1]) {
			player.getPackets().sendConfigByFile(lodeStones[0][0], 1);
			activatedLodeStones[0] = true;
		}
	}

	/**
	 * Checks if the player has unlocked the lodestone.
	 * 
	 * @Param player
	 */
	public void checkActivation(final Player player) {
		if (activatedLodeStones[0] == true) {
			player.getPackets().sendConfigByFile(lodeStones[0][0], 1);
		}
	}

}